<?php
/**
 * @description : when you forget your password,this page will help you to find the password.
 * @author      : stephen.mo <stephen.mo@achievo.com>
 * @date        : Dec 1,2010
 */
require_once "TVB/OAuth/common.inc.php";
#ini_set('display_errors','on');

$current_page     = OAuthConfig::PAGE_FORGET_PASSWORD;
$reback_url       = (isset($_REQUEST['reback_url'])) ? $_REQUEST['reback_url'] : NULL;
$lang             = (isset($_REQUEST['lang'])) ? OAuthUtils::chkLang($_REQUEST['lang']) : OAuthModelConfig::DEFAULT_SUPPORT_LANG;

//path setting.
$base_server_path = OAuthConfig::OAuthDomainUrl($_SERVER);
$jqtouch_url      = $base_server_path.OAuthModelConfig::DEFAULT_MOBILE_TEMPLATE;
$ajax_url         = $base_server_path.OAuthConfig::DEFAULT_AJAX_URL;
$default_header   = $base_server_path.OAuthConfig::DEFAULT_HEADER_URL;
$succ_url         = $base_server_path.OAuthConfig::DEFAULT_SHOW_MESSAGE_URL.'?act=fpass&flag=success';
$back_url         = $default_header.'?oauth_reback='.urlencode($reback_url);
$success_url      = $default_header.'?oauth_reback='.urlencode($succ_url);
//page info vars.
$forget_pass_page = OPI::$forget_password;
$payment_buttons  = OPI::$payment_button_info;

//setting the form datas into array.
$using_real_env           = OAuthModelConfig::USING_TEMPLATE_ON_REAL_ENV;
$page                     = OAuthModelConfig::M_PAGE_OF_FPASSWORD; 
$form                     = array();
$form['lang']             = $lang;
$form['title']            = $forget_pass_page[$lang]['page_title'];
$form['action']           = NULL;
$form['method']           = 'POST';

$form['forget_title']     = $forget_pass_page[$lang]['fpassword_title'];
$form['forget_note']      = $forget_pass_page[$lang]['fpassword_note'];
$form['ajax_url']         = $ajax_url;
$form['success_url']      = $success_url;

$form['hidden']['item']   = 'forgetPassword';
$form['email']['title']   = $forget_pass_page[$lang]['fpassword_email'];
$form['email']['value']   = NULL;
$form['button']['cancel'] = array('value'=>$payment_buttons[$lang]['back'],
                                  'link'=>$back_url);
$form['button']['submit'] = array('value'=>$payment_buttons[$lang]['submit'],
                                  'link'=>NULL);

//include this template for forget password page.
include "..".OAuthModelConfig::DEFAULT_MOBILE_TEMPLATE.OAuthModelConfig::$mobile_teplate_page[$page];

?>
